<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
  <title>tyapp</title>
  <link rel="stylesheet" href="static/swiper.css"/>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.11&key=e024942bed9634803a386f2ec0e2f0fe"></script>
<!--<script src="//unpkg.com/vue-ydui/dist/ydui.flexible.js"></script>-->
<!--<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=RAKoveCQGYcBaEKFDYuk75OSqoWo1QXd"></script>-->
<script src="//g.alicdn.com/fdilab/lib3rd/viewport-units-buggyfill/0.6.2/??viewport-units-buggyfill.hacks.min.js,viewport-units-buggyfill.min.js"></script>
<script>
  window.onload = function () {
    window.viewportUnitsBuggyfill.init({hacks: window.viewportUnitsBuggyfillHacks});
  }
  //判断有无网络连接
  if (navigator && navigator.onLine === false){
    mui.toast('请连接网络');
  }
  mui.init({
    keyEventBind: {
      backbutton: true  //关闭back按键监听
    }
  });
  // //首页返回键处理
  // //处理逻辑：1秒内，连续两次按返回键，则退出应用；
  let first = null;
  mui.back = function () {
    //首次按键，提示  再按一次退出应用
    if (!first) {
      first = new Date().getTime();//记录第一次按下回退键的时间
      mui.toast('再按一次退出应用');//给出提示
      history.go(-1)//回退到上一页面
      setTimeout(function () {//1s中后清除
        first = null;
      }, 1000);
    } else {
      if (new Date().getTime() - first < 1000) {//如果两次按下的时间小于1s，
        plus.runtime.quit();//那么就退出app

      }
    }
  };
</script>
</html>
